package com.example.financialsystem;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import models.Book;
import models.UserVO;

import static others.Const.CURRENT_USER;
import static others.Const.currentBook;
import static others.Const.currentUserVo;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //延时跳转
        handler.sendEmptyMessageDelayed(0,3000);
    }

    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            goLoginActivity();
            super.handleMessage(msg);
        }
    };

    public void goLoginActivity(){
//        //测试代码
//        Intent intent = new Intent(this,HomeScreenActivity.class);
//        UserVO userVO = new UserVO("0cd7966e5d664f92a15d0408c62b0df8","admin",
//                "19982059864","1710548477@qq.com");
//        currentUserVo = userVO;
//        Book book = new Book("65730d15a66c4b4189d696b221a077b4","Android测试本",0);
//        currentBook = book;
//        intent.putExtra(CURRENT_USER,userVO);


        //正式代码
        Intent intent = new Intent(this, LoginActivity.class);
        startActivity(intent);
        finish();
    }
}
